/* skill.h */
/* author: jiqing */
/* create: 2012-01-04 */
// update: 2014-04-30 Wed

#ifndef _SKILL_H_
#define _SKILL_H_

#include "TextParser.h"

typedef enum {
    eSelf = 0,
    eSelfAll,
    eRange,
    eEnemy,
    eEnemyAll
} TARGETTYPE;

typedef enum {
    eSword = (1 << 0),
    eBlade = (1 << 1),
    eHand = (1 << 2),
    eLong = (1 << 3),
    eKongFu = (1 << 4),
    eMagic = (1 << 5),
    eFire = (1 << 6),
    eAir = (1 << 7),
    eWater = (1 << 8),
    eEarth = (1 << 9)
} SKILLCLASS;

class CSkill
{
public:
    char szName[32];
    char szDesc[256];
    short nSklCls; // 0 - sword, 1 - blade, 2 - long, 3 -hand

    short nLvlUp;  // n * nLvlUp to level up
    short nPreExp; // experience to szudy this skill
    short nAddExp; // each perform add experience lvl * nAddExp 

    short nAddHp;
    short nAddMp;
    short nAddAttack;
    short nAddDef;
    short nAddSpeed;

    short nPower;
    short nMpCost;
public:
    void ShowName();
    void ShowDetail();
    short Damage(short lvl);
    short MpCost(short lvl);
    bool Load(CTextParser &file);
};

// typedef struct
// {
// 	char szName[32];        // The name of skill
// 	char szDesc[256];       // The description of skill

//     short eTarget;          // The target of skill
//     short nAddHP;           // HP added to target
//     short nAddMP;           // MP added to target
//     short nAddAttack;       // Attack added to target
//     short nAddDexerity;     // Dexerity added to target
//     short nAddDefence;      // Defence added to target

//     short nMaxLevel;
//     short nLvlUp;  // n * nLvlUp to level up
//     short nAddMaxHP;
//     short nAddMaxMP;
//     short nAddAttackForever;
//     short nAddDefenceForever;
//     short nAddDexerityForever;

// 	short nMpCost;

//     short nSkillClass; 
// 	short nPreExp; // experience to study this skill
//     short nAddExp; // each perform add experience lvl * nAddExp 
// } SKILL, *LPSKILL;

#endif
